package com.dingreading.cloud.mall.service;

import com.dingreading.cloud.common.util.PageUtil;
import com.dingreading.cloud.mall.dto.OrderFormDto;
import com.dingreading.cloud.mall.entity.DeliveryAddress;
import com.dingreading.cloud.mall.entity.OrderForm;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;

import java.util.Map;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface OrderFormService extends IService<OrderForm> {

    Page<OrderForm> pageList(PageUtil pageUtil, String storeUid, String staffUid, String keyword, Integer projectType,
                             Integer status, Integer roleType, String beginDate, String endDate, String payChannelCode, Integer financeStatus);

    OrderForm getByCode(String staffUid, String code);

    // 删除订单
    int deleteByStaffIdAndCode(String staffUid, String code);

    //修改收货地址
    boolean updateAddress(String staffUid, String code, DeliveryAddress address);

    // 取消订单
    boolean cancelOrder(String staffUid, String code);

    // 提交已支付
    boolean payOkGoodsOrder(String staffUid, String code, Integer payType, String tradeType, String payId, String tradeNo, Integer payOnline, String payTime);

    // 赠品订单提交已支付
    boolean payOkGiftGoodsOrder(String staffUid, String code, Integer payType, String tradeType, String payChannelCode, String payTime);

    Integer getFormStatus(String staffUid, String code);


    Map<String, String> getStatusNum(String storeUid, String staffUid);

    // 修改订单的支付通道
    void updatePayChannelCode(String staffUid, String code, String payChannelCode);

    // 修改订单的支付通道和收款公司
    void updatePayChannelCodeAndCorpPay(String staffUid, String code, String payChannelCode);

    // 申请银行转账
    boolean applyBankPay(String storeUid, String code, String payTime);

    // 客户取消银行转账
    boolean cancelBankPay(String storeUid, String code);

    Page<OrderFormDto> staffPageList(PageUtil pageUtil, String storeUid, String staffUid, String keyword, Integer status);

}
